package com.hd.crdao.activity;

import android.app.Activity;
import android.os.Bundle;
import android.view.MotionEvent;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.hd.crdao.R;
import com.hd.crdao.utils.ALog;
import com.hd.crdao.utils.SPUtils;
import com.hd.crdao.utils.UIUtils;

/**
 *
 *@author Programming
 *@date 2017/5/26 0026
 */
public class ViewBigPicActivity extends Activity {
    public ImageView mBigImage;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_viewbigpic);
        initview();
    }

    private void initview() {
        String headimagespath = SPUtils.getString("headphotopath","");
        ALog.d(headimagespath);
        mBigImage = (ImageView) findViewById(R.id.bigimage);
        Glide.with(UIUtils.getContext())
                .load(headimagespath)
                .placeholder(R.drawable.base_3x)
                .into(mBigImage);
    }

    int num=1;
    @Override
    public boolean onTouchEvent(MotionEvent event) {
        switch (event.getAction()) {
            case MotionEvent.ACTION_DOWN:
                num ++;
                if(num==2){
                    finish();
                }
                break;
        }
        return super.onTouchEvent(event);
    }

}

